<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item of banners" :key="item.id">
          <img :src="item.imageUrl" alt="" @click="handleClick">
          
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
 
<script>
import axios from'axios';
export default {
  data() {
    return {
     banners:[]
    };
  },
  methods: {
    handleClick() {
      this.$router.push("/moviedetail/")

    },
  },
  mounted(){
       axios.get("http://122.112.161.135:3000/banner").then(res=>{
            console.log(res.data.banners);
            this.banners = res.data.banners
        })
  }
};
</script>
<style scoped>
    img{
        width: 100%;
    }
</style>